/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-

   credenza-search-directory.h: Subclass of CredenzaDirectory to implement
   a virtual directory consisting of the search directory and the search
   icons
 
   Copyright (C) 2005 Novell, Inc
  
   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public License as
   published by the Free Software Foundation; either version 2 of the
   License, or (at your option) any later version.
  
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.
  
   You should have received a copy of the GNU General Public
   License along with this program; if not, write to the
   Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/

#ifndef CREDENZA_SEARCH_DIRECTORY_H
#define CREDENZA_SEARCH_DIRECTORY_H

#include <libcredenza-private/credenza-directory.h>
#include <libcredenza-private/credenza-query.h>

#define CREDENZA_TYPE_SEARCH_DIRECTORY credenza_search_directory_get_type()
#define CREDENZA_SEARCH_DIRECTORY(obj) \
  (G_TYPE_CHECK_INSTANCE_CAST ((obj), CREDENZA_TYPE_SEARCH_DIRECTORY, CredenzaSearchDirectory))
#define CREDENZA_SEARCH_DIRECTORY_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_CAST ((klass), CREDENZA_TYPE_SEARCH_DIRECTORY, CredenzaSearchDirectoryClass))
#define CREDENZA_IS_SEARCH_DIRECTORY(obj) \
  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CREDENZA_TYPE_SEARCH_DIRECTORY))
#define CREDENZA_IS_SEARCH_DIRECTORY_CLASS(klass) \
  (G_TYPE_CHECK_CLASS_TYPE ((klass), CREDENZA_TYPE_SEARCH_DIRECTORY))
#define CREDENZA_SEARCH_DIRECTORY_GET_CLASS(obj) \
  (G_TYPE_INSTANCE_GET_CLASS ((obj), CREDENZA_TYPE_SEARCH_DIRECTORY, CredenzaSearchDirectoryClass))

typedef struct CredenzaSearchDirectoryDetails CredenzaSearchDirectoryDetails;

typedef struct {
	CredenzaDirectory parent_slot;
	CredenzaSearchDirectoryDetails *details;
} CredenzaSearchDirectory;

typedef struct {
	CredenzaDirectoryClass parent_slot;
} CredenzaSearchDirectoryClass;

GType   credenza_search_directory_get_type             (void);

char   *credenza_search_directory_generate_new_uri     (void);

CredenzaSearchDirectory *credenza_search_directory_new_from_saved_search (const char *uri);

gboolean       credenza_search_directory_is_saved_search (CredenzaSearchDirectory *search);
gboolean       credenza_search_directory_is_modified     (CredenzaSearchDirectory *search);
gboolean       credenza_search_directory_is_indexed      (CredenzaSearchDirectory *search);
void           credenza_search_directory_save_search     (CredenzaSearchDirectory *search);
void           credenza_search_directory_save_to_file    (CredenzaSearchDirectory *search,
							  const char              *save_file_uri);

CredenzaQuery *credenza_search_directory_get_query       (CredenzaSearchDirectory *search);
void           credenza_search_directory_set_query       (CredenzaSearchDirectory *search,
							  CredenzaQuery           *query);

#endif /* CREDENZA_SEARCH_DIRECTORY_H */
